//
// * Copyright (c) 2002-2009 "Neo Technology,"
// *     Network Engine for Objects in Lund AB [http://neotechnology.com]
// *
// * This file is part of Neo4j.
// * 
// * Neo4j is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Affero General Public License as
// * published by the Free Software Foundation, either version 3 of the
// * License, or (at your option) any later version.
// * 
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// * GNU Affero General Public License for more details.
// * 
// * You should have received a copy of the GNU Affero General Public License
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
// 
namespace org.neo4j.kernel.impl.nioneo.xa
{

	using PropertyIndex = org.neo4j.kernel.impl.core.PropertyIndex;
	using PropertyData = org.neo4j.kernel.impl.nioneo.store.PropertyData;
	using RelationshipChainPosition = org.neo4j.kernel.impl.nioneo.store.RelationshipChainPosition;
	using RelationshipData = org.neo4j.kernel.impl.nioneo.store.RelationshipData;
	using ArrayMap = org.neo4j.kernel.impl.util.ArrayMap;

///
/// <summary> * Defines the operations in Neo4j kernel that are relationship related. </summary>
/// 
	public interface RelationshipEventConsumer
	{
///    
///     <summary> * Creates a relationship.
///     *  </summary>
///     * <param name="id">
///     *            The id of the relationship </param>
///     * <param name="directed">
///     *            Set to <CODE>true</CODE> if relationship is directed </param>
///     * <param name="firstNode">
///     *            The first node connected </param>
///     * <param name="secondNode">
///     *            The second node connected </param>
///     * <param name="type">
///     *            The id of the relationship type </param>
///     * <exception cref="IOException">
///     *             If unable to create the relationship </exception>
///     
		void createRelationship(int id, int firstNode, int secondNode, int type);

///    
///     <summary> * Deletes relationship with the given id.
///     *  </summary>
///     * <param name="id">
///     *            The id of the relationship </param>
///     * <exception cref="IOException">
///     *             If unable to delete the relationship </exception>
///     
		void deleteRelationship(int id);

///    
///     <summary> * Adds a property to the relationship.
///     *  </summary>
///     * <param name="relId">
///     *            The id of the relationship to add the property to </param>
///     * <param name="propertyId">
///     *            The id of the property </param>
///     * <param name="key">
///     *            The key of the property </param>
///     * <param name="value">
///     *            The value of the property </param>
///     * <exception cref="IOException">
///     *             If unable to add property </exception>
///     
		void addProperty(int relId, int propertyId, PropertyIndex index, object value);

///    
///     <summary> * Changes the value of a property on a relationship.
///     *  </summary>
///     * <param name="propertyId">
///     *            The id of the property </param>
///     * <param name="value">
///     *            The new value </param>
///     * <exception cref="IOException">
///     *             If unable to change property </exception>
///     
		void changeProperty(int relId, int propertyId, object value);

///    
///     <summary> * Removed a property from a relationship.
///     *  </summary>
///     * <param name="relId">
///     *            The id of the relationship </param>
///     * <param name="propertyId">
///     *            The id of the property </param>
///     * <exception cref="IOException">
///     *             If unable to remove property </exception>
///     
		void removeProperty(int relId, int propertyId);

///    
///     <summary> * Returns all properties connected to a relationship.
///     *  </summary>
///     * <param name="relId">
///     *            The id of the relationship </param>
///     * <returns> An array containing all properties connected to the relationship </returns>
///     * <exception cref="IOException">
///     *             If unable to get the properties </exception>
///     
		ArrayMap<int, PropertyData> getProperties(int relId);

///    
///     <summary> * Gets a relationship with a given id.
///     *  </summary>
///     * <param name="id">
///     *            The id of the relationship </param>
///     * <returns> The relationship data </returns>
///     * <exception cref="IOException">
///     *             if unable to get the relationship </exception>
///     
		RelationshipData getRelationship(int id);

		RelationshipChainPosition getRelationshipChainPosition(int nodeId);

		IEnumerable <RelationshipData> getMoreRelationships(int nodeId, RelationshipChainPosition position);
	}
}